package org.dromara.common.translation.core.impl;

import lombok.RequiredArgsConstructor;
import org.dromara.common.translation.annotation.TranslationType;
import org.dromara.common.translation.constant.TransConstant;
import org.dromara.common.translation.core.TranslationInterface;
import org.dromara.resource.api.services.ResourceFileClientApiService;

/**
 * OSS翻译实现
 *
 * @author shuai.zhou
 */
@RequiredArgsConstructor
@TranslationType(type = TransConstant.OSS_ID_TO_URL)
public class OssUrlTranslationImpl implements TranslationInterface<String> {

    private final ResourceFileClientApiService resourceFileClientApiService;

    @Override
    public String translation(Object key, String other) {
        return resourceFileClientApiService.getFileUrlByOssIds(key.toString());
    }

}
